<template>
  <!-- 页面弹出框-->
  <el-dialog
    title="多边轧差净额结算借贷通知报文查询明细"
    center
    :visible.sync="open"
    width="1024px"
    :close-on-click-modal="true"
    @close="closeFn"
  >
    <el-form ref="detailsForm" :model="formData" label-width="150px" :disabled="true">
      <el-card class="form-card payerInfo-card">
        <div slot="header" class="label-header-msg">
          <span>基本信息</span>
        </div>
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="交易流水号：" prop="id">
              <el-input v-model="formData.id" placeholder="" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="报文标识号：" prop="pkgId">
              <el-input v-model="formData.pkgId" placeholder="" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="CPG日期：" prop="workdate">
              <el-date-picker
                v-model="formData.workdate"
                type="date"
                value-format="yyyyMMdd"
                placeholder=""
                style="width: 100%"
              ></el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="工作日期：" prop="vdate">
              <el-date-picker
                v-model="formData.vdate"
                type="date"
                value-format="yyyyMMdd"
                placeholder=""
                style="width: 100%"
              ></el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="报文类型：" prop="pkgNo">
              <el-select v-model="formData.pkgNo" placeholder="" style="width: 100%">
                <el-option
                  v-for="dict in dictMap.PKG_TYPE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="来往账标志：" prop="drct">
              <el-select v-model="formData.drct" placeholder="" style="width: 100%">
                <el-option
                  v-for="dict in dictMap.DRCTCODE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="系统编号：" prop="sysCode">
              <el-select v-model="formData.sysCode" placeholder="" style="width: 100%">
                <el-option
                  v-for="dict in dictMap.SYS_CODE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="业务类型：" prop="bizTypeCode">
              <el-select v-model="formData.bizTypeCode" placeholder="" disabled style="width: 100%">
                <el-option
                  v-for="dict in dictMap.BIZ_TYPE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="业务种类" prop="bizCtgyCode">
              <el-select
                style="width: 100%"
                v-model="
                  formData.bizCtgyCode === null || formData.bizCtgyCode === undefined
                    ? ''
                    : formData.bizCtgyCode + '-' + formData.bizCtgyCodeDesc
                "
                placeholder="业务种类"
                :disabled="true"
              ></el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="内部机构号：" prop="brno">
              <el-select style="width: 100%" v-model="formData.brno" placeholder="">
                <el-option
                  v-for="dict in dictMap['Cnaps2Dict.CP2_BRNO']"
                  :key="dict.value"
                  :label="`${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col :span="24">
            <el-form-item label="备注：" prop="remarks">
              <el-input type="textarea" v-model="formData.remarks" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col :span="24">
            <el-form-item label="附言：" prop="addInfo">
              <el-input type="textarea" v-model="formData.addInfo" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>
      <el-card class="form-card payerInfo-card">
        <div slot="header" class="label-header-msg">
          <span>原报文信息：</span>
        </div>
        <el-row>
          <el-col :span="12">
            <el-form-item label="原报文标识号：" prop="oriPkgId">
              <el-input v-model="formData.oriPkgId" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="原发起参与机构：" prop="oriSender">
              <el-input v-model="formData.oriSender" placeholder="" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="原发起参与机构名：" prop="oriSenderName">
              <el-input v-model="formData.oriSenderName" placeholder="" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="原报文类型：" prop="oriMsgType">
              <el-select v-model="formData.oriMsgType" placeholder="" style="width: 100%">
                <el-option
                  v-for="dict in dictMap.PKG_TYPE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>

      <el-card class="form-card payerInfo-card">
        <div slot="header" class="label-header-msg">
          <span>通知信息</span>
        </div>
        <el-row>
          <el-col :span="12">
            <el-form-item label="借贷标识：" prop="cdIndicator">
              <el-select v-model="formData.cdIndicator" placeholder="" style="width: 100%">
                <el-option
                  v-for="dict in dictMap.CREDITDEBITCODE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="轧差场次：" prop="nettingRound">
              <el-input v-model="formData.nettingRound" placeholder="" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="客户业务金额币种：" prop="curcd">
              <el-input v-model="formData.curcd" placeholder="" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="客户业务金额：" prop="amount">
              <el-input v-model="formData.amount" placeholder="" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="当前余额币种：" prop="balCurcd">
              <el-input v-model="formData.balCurcd" placeholder="" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="当前余额：" prop="balAmount">
              <el-input v-model="formData.balAmount" placeholder="" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>
      <el-card class="form-card payerInfo-card">
        <div slot="header" class="label-header-msg">
          <span>NPC处理信息</span>
        </div>
        <el-row>
          <el-col :span="12">
            <el-form-item label="中心状态" prop="procStatus">
              <el-select style="width: 100%" v-model="formData.procStatus" placeholder="" :disabled="true">
                <el-option
                  v-for="dict in dictMap.PROCESSSTATUS"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="NPC处理码：" prop="procCode">
              <el-select v-model="formData.procCode" placeholder="" style="width: 100%">
                <el-option
                  :label="`${formData.procCode}-${formData.procCodeDesc}`"
                  :value="formData.procCode"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="NPC拒绝信息：" prop="rejectInfo">
              <el-input v-model="formData.rejectInfo" placeholder="" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="NPC轧差日期：" prop="chkDate">
              <el-date-picker
                v-model="formData.chkDate"
                type="datetime"
                value-format="yyyyMMdd"
                placeholder=""
                style="width: 100%"
              ></el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="NPC轧差场次：" prop="chkRound">
              <el-input v-model="formData.chkRound" placeholder="" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="NPC清算日期/终态日期：" prop="clrDate">
              <el-date-picker v-model="formData.clrDate" style="width: 100%" type="date" value-format="yyyyMMdd" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="接收时间：" prop="rcvTime">
              <el-date-picker
                style="width: 100%"
                v-model="formData.rcvTime"
                value-format="yyyyMMddHHmmss"
                type="datetime"
              />
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>
    </el-form>
    <ht-table
      ref="detailsDataTable"
      :showSerialNumber="false"
      :multi-select="false"
      :dictMap="dictMap"
      :initData="false"
      :reqConfig="reqConfig"
      :queryParams="detailsQueryParams"
      :tableBindColumns="tableBindColumns"
      defaultEventKey="detailsTable"
      style="height: 240px"
    ></ht-table>
    <div slot="footer" class="dialog-footer">
      <el-button @click="closeFn">关闭</el-button>
    </div>
  </el-dialog>
</template>
<script>
import { detailsApiUrlConfig } from "@/api/cnaps/baseBiz/inquire/multi_rolling_net_amt_settle_loan_query.js";

export default {
  name: "MultiRollingNetQueryDetails",
  components: {},
  props: {
    dictMap: {
      type: Object,
      default: () => {
        return {};
      },
    },
    formData: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {
      reqConfig: detailsApiUrlConfig,
      detailsQueryParams: {
        id: "",
      },
      // 是否显示弹出层
      open: false,
      tableBindColumns: [
        {
          label: `客户开户行行号`,
          prop: "accBrno",
          width: "195",
          align: "center",
        },
        {
          label: `客户账号`,
          prop: "actno",
          width: "195",
          align: "center",
        },
        {
          label: `客户户名`,
          prop: "actname",
          width: "195",
          align: "center",
        },
        {
          label: `客户业务金额币种`,
          prop: "curcd",
          width: "195",
          align: "center",
        },
        {
          label: `客户业务金额`,
          prop: "amount",
          width: "190",
          align: "center",
          type: "price",
        },
      ],
    };
  },
  mounted() {},

  watch: {
    formData: function (newData) {
      this.detailsQueryParams.id = newData.id;
      this.$refs.detailsDataTable.doQuery();
    },
  },
  methods: {
    // 表单重置
    reset() {
      this.resetForm("logForm");
      // this.$set(this, "form", {});
    },
    closeFn() {
      this.open = false;
    },
    show() {
      this.open = true;
    },
    cancel() {
      this.open = false;
      this.reset();
    },
  },
};
</script>
<style>
.label-header-msg {
  font-weight: bold;
}

.form-card {
  margin-bottom: 10px;
}
</style>
